"""
Plotting functions for fields
"""

function plot_field(field::ScalarField)
    g = grid(field)
    if ndim(g) == 1
        x = [coordinate(g, (i,))[1] for i in 1:size(g)[1]]
        return Plots.plot(x, vec(data(field)), label="u(x)")
    elseif ndim(g) == 2
        return Plots.heatmap(data(field), aspect_ratio=:equal)
    else
        error("Cannot plot $(ndim(g))D fields directly")
    end
end

plot_field(field::AbstractField) = plot_field(field)

function plot_time_series(times::Vector{Float64}, values::Vector{Float64}; label="Series")
    return Plots.plot(times, values, label=label)
end